                            <div class="main">
                                <h3 class="title"><?=$clabel?> &raquo; <?=$mlabel?></h3>
                                <div class="formdiv">
                                    <form method="POST" id="frmAddTerm">
                                        <table>
                                            <? if( isset($errors) ) {
                                               foreach($errors as $error) {
                                               ?>
                                            <tr>
                                                <td class="errormsg" colspan="3">
                                                    <?=$error?>    
                                                </td>
                                            </tr>   
                                               <? 
                                               } 
                                            }  ?>
                                            <? if( isset($successes) ) {
                                               foreach($successes as $success) {
                                               ?>
                                            <tr>
                                                <td class="successmsg" colspan="3">
                                                    <?=$success?>    
                                                </td>
                                            </tr>   
                                               <? 
                                               } 
                                            }  ?>
                                            
                                            <tr>
                                                <td><label for="term_name">Term Name*</label></td>
                                                <td>
                                                    <input type="text" class="text required" minlength="2" maxlength="50" name="term_name" value="<?=$postdata['term_name']?>" />
                                                </td>
                                                <td></td>
                                            </tr>
                                            <tr>
                                                <td><label for="term_start">Term Start*</label></td>
                                                <td>
                                                    <select class="text required" name="term_start">
                                                        <option value="">-- Select --</option>
                                                        <?    
                        	                               for( $ms = 1; $ms <= 12; $ms++  ) {
                            	                               $sel = '';
                            	                               if(isset($postdata["term_start"]) && $ms==$postdata["term_start"]) { $sel = "selected"; }
                                                        ?>
                                                                <option value="<?=$ms?>" <?=$sel?>><?=date( 'F', mktime(0, 0, 0, $ms) )?></option>
                                                        <?
                            	                           }
                                                        ?>
                                                    </select>
                                                </td>
                                                <td></td>
                                            </tr>
                                            <tr>
                                                <td><label for="term_end">Term End*</label></td>
                                                <td>
                                                    <select class="text required" name="term_end">
                                                        <option value="">-- Select --</option>
                                                        <?    
                        	                               for( $me = 1; $me <= 12; $me++  ) {
                            	                               $sel = '';
                            	                               if(isset($postdata["term_end"]) && $me==$postdata["term_end"]) { $sel = "selected"; }
                                                        ?>
                                                                <option value="<?=$me?>" <?=$sel?>><?=date( 'F', mktime(0, 0, 0, $me) )?></option>
                                                        <?
                            	                           }
                                                        ?>
                                                    </select>
                                                </td>
                                                <td></td>
                                            </tr>
                                        	<tr>
                                        		<td></td>
                                        		<td colspan="2">
                                                    <input class="button" type="submit" name="btnAddTerm" value="Add" id="btnAddTerm" />
                                                    <input class="button" type="reset" value="Cancel" id="btnreset" />
                                                </td>
                                        	</tr>
                                        </table>
                                	</form>
                                    <script language="javascript" type="text/javascript">
                                        if(typeof jQuery == 'undefined') {
                                            alert('Invalid Request');
                                            window.location = "/";
                                        }
                                        $(document).ready( function() {
                                            $("#frmAddTerm").validate({
                                                errorPlacement: function(error, element) {
                                                    placeError(error, element);
                                                },
                                                submitHandler: function(form) {
                                                    var cui = $('#contenttabs .ui-tabs-panel:visible');                                                                                                        
                                               	    var jqxhr = $.post(
                                                        "/school/AddTerm", 
                                                        $("#frmAddTerm").serialize(), 
                                                        function (data) {
                                                            $(cui).html(data);
                                                        }
                                                    );
                                                    $(cui).html('<div id="loadingdiv"><div class="centerdiv"><strong>Processing</strong><br/><img src="/images/ajaxloader.gif" /></div></div>');
                                                }
                                            });
                                            $("#frmAddTerm input[type='reset']").click( function() {
                                                $('#frmAddTerm label.error').remove();
                                            });                                            
                                        });
                                    </script>
                                 </div>
                            </div>